<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
    <base href="/oa1/" />
    <title>襄阳蓝芯智能化办公系统 - 名片详情</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="static/bootstrap-3.3.5/css/bootstrap.css" rel="stylesheet">
    <style>
        .thead-blue {
            color: #fff;
            font-weight: bold;
            background-color: #337ab7;
        }
    </style>
    <script src="static/jquery/jquery-1.10.2.min.js"></script>
    <script src="static/bootstrap-3.3.5/js/bootstrap.min.js"></script>
</head>
<body>

<div class="panel panel-primary">
    <table class="table table-bordered table-hover">
        <thead>
        <tr class="thead-blue">
            <td colspan="6">名片详情</td>
        </tr>
        </thead>
        <tbody>
        <tr>
            <td class="col-md-1"><label>姓名</label></td>
            <td class="col-md-3">${contact.name}</td> <!-- 动态姓名 -->
            <td class="col-md-1"><label>性别</label></td>
            <td class="col-md-3">${contact.sex == 'M' ? '男' : '女'}</td> <!-- 动态性别 -->
            <td class="col-md-1"><label>名片夹</label></td>
            <td class="col-md-3">${typeName}</td> <!-- 动态类型名称 -->
        </tr>

        <tr>
            <td><label>公司</label></td>
            <td>${contact.company}</td> <!-- 动态公司 -->
            <td><label>个人电话</label></td>
            <td>${contact.mobile}</td> <!-- 动态手机号 -->
            <td><label>个人邮箱</label></td>
            <td>${contact.email1 == null ? '' : contact.email1}</td> <!-- 动态个人邮箱（处理空值） -->
        </tr>

        <tr>
            <td><label>家庭电话</label></td>
            <td>${contact.homePhone == null ? '' : contact.homePhone}</td> <!-- 动态家庭电话 -->
            <td><label>家庭地址</label></td>
            <td>${contact.homeAddress == null ? '' : contact.homeAddress}</td> <!-- 动态家庭地址 -->
            <td><label>家庭邮编</label></td>
            <td>${contact.homeZipcode == null ? '' : contact.homeZipcode}</td> <!-- 动态家庭邮编 -->
        </tr>
        <tr>
            <td><label>办公电话</label></td>
            <td>${contact.officePhone == null ? '' : contact.officePhone}</td> <!-- 动态办公电话 -->
            <td><label>办公地址</label></td>
            <td>${contact.officeAddress == null ? '' : contact.officeAddress}</td> <!-- 动态办公地址 -->
            <td><label>办公邮编</label></td>
            <td>${contact.officeZipcode == null ? '' : contact.officeZipcode}</td> <!-- 动态办公邮编 -->
        </tr>
        <tr>
            <td><label>办公邮箱</label></td>
            <td>${contact.email2 == null ? '' : contact.email2}</td> <!-- 动态办公邮箱 -->
            <td><label>其它信息</label></td>
            <td colspan="3">${contact.other == null ? '' : contact.other}</td> <!-- 动态其它信息 -->
        </tr>
        <tr>
            <td colspan="6" align="center">
                <a type="button" href="javascript:history.back()" class="btn btn-info">返回</a>
            </td>
        </tr>
        </tbody>
    </table>
</div>


<script type="text/javascript">
    $(document).ajaxError(function(event,xhr) {
        if(xhr.status=="403"){//没有权限
            document.location.href = xhr.getResponseHeader("url");
        }else if(xhr.status!="200"){
            console.log("服务器错误!");
        }
    });
</script>

</body>
</html>